import turtle
import time

# 画一条线
# 画一个数字
# 画一个时钟
# 加年月日
# 加颜色

# 画一条线
def drawLine(mark):
    if mark == True:
        turtle.pendown()
    elif mark == False:
        turtle.penup()
    turtle.fd(40)
    turtle.right(90)


# 画一个数字
def drawSingleDigit(num):     # num 为0-9 的一个数字
    drawLine(True) if num in [2,3,4,5,6,8,9] else drawLine(False)
    drawLine(True) if num in [0,3,4,5,6,7,8,9] else drawLine(False)
    drawLine(True) if num in [0,2,3,5,6,8,9] else drawLine(False)
    drawLine(True) if num in [0,1,2,6,8] else drawLine(False)
    turtle.left(90)
    drawLine(True) if num in [0,1,4,5,6,8,9] else drawLine(False)
    drawLine(True) if num in [0,2,3,5,6,7,8,9] else drawLine(False)
    drawLine(True) if num in [0,2,3,4,7,8,9] else drawLine(False)
    turtle.left(180)
    turtle.penup()
    turtle.fd(10)

# 画一组数字
def drawNums(nums):
    for i in str(nums):
        drawSingleDigit(eval(i))


def drawDate():
    standardTime = time.strftime('%Y-%m+%d*', time.gmtime())
    turtle.pencolor('red')
    for i in standardTime:
        if i == '-':
            turtle.write('年',font=('Arial', 12, 'normal'))
            turtle.pencolor('green')
            turtle.penup()
            turtle.fd(40)
        elif i == '+':
            turtle.write('月', font=('Arial', 12, 'normal'))
            turtle.pencolor('blue')
            turtle.penup()
            turtle.fd(40)
        elif i == '*':
            turtle.write('日', font=('Arial', 12, 'normal'))
            turtle.penup()
            turtle.fd(40)
        else:
            drawSingleDigit(eval(i))



def main():
    turtle.penup()
    turtle.bk(200)
    turtle.pensize(5)
    turtle.hideturtle()
    drawDate()
    turtle.done()

# main()


#科赫雪花
turtle.pendown()
def koch(size, n):
    if n == 0:
        turtle.fd(size)
    else:
        for angle in [0, 60, -120, 60]:
            turtle.left(angle)
            koch(size/3, n-1)

koch(300,3)
turtle.done()